//
//  SDDetectionView.m
//  skinDetection
//
//  Created by  liangzhun on 2018/10/29.
//  Copyright © 2018年  liangzhun. All rights reserved.
//

#import "SDDetectionView.h"

@implementation SDDetectionView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
- (void)starAnimation
{
    [self starAnimationView:self.aroundLeft positive:1];
    [self starAnimationView:self.aroundRight positive:-1];
    
}

- (void)starAnimationView :(UIView *)view positive:(int)ispositive
{
    
    CABasicAnimation *rotationAnimation =  [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
    rotationAnimation.toValue = [NSNumber numberWithFloat: ispositive*M_PI * 2.0];
    rotationAnimation.duration = 6.f;
    rotationAnimation.cumulative = YES;
     rotationAnimation.removedOnCompletion = NO;
    rotationAnimation.repeatCount = HUGE_VAL;
    [view.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
    
}

@end
